package com.obrempon.credit.market.sdk.device.util

import com.obrempon.credit.market.configs.ObremponConfigs
import com.obrempon.credit.market.utils.helper.ObremponConfigsHelper

/**
 * MullaFlow
 * @Author wwdeng
 * @CreateTime: 2025/1/6 13:42
 * @Annotation：短信关键词过滤
 */
fun ObremponDeviceMSAGMobileFilters(): MutableSet<String> {
    // SMS mobile 关键词
    val mobileFilters = mutableSetOf("")
    //赞比亚
    if (ObremponConfigs.isObremponZmb()){
        mobileFilters.clear()
        mobileFilters.addAll(mutableSetOf("money", "airtel", "momo", "cash", "mwachangu", "kwacha", "zanaco", "tclnotebiu", "loan", "unifisiliza", "211", "kyc", "mtn"))
    }

    //贝宁 不过滤
    if (ObremponConfigs.isObremponBenin()){
        mobileFilters.clear()
    }

    //客服配置读取 Mobile 关键字
    val mobileKeys = ObremponConfigsHelper.takeObremponMSGMobileKeys()
    if (mobileKeys != null){
        mobileFilters.addAll(mobileKeys)
    }

    return mobileFilters
}

fun ObremponDeviceMSAGContentFilters(): MutableSet<String> {
    //SMS Content 关键词
    val contentFilters = mutableSetOf("")

    //赞比亚
    if (ObremponConfigs.isObremponZmb()){
        contentFilters.clear()
        contentFilters.addAll(mutableSetOf("money", "airtel", "mtn", "momo", "lend", "loan", "cash", "otp", "pin", "code", "credit", "kash", "verification", "due", "payment", "password", "settle", "paid", "approved", "application"))
    }

    //贝宁 不过滤
    if (ObremponConfigs.isObremponBenin()){
        contentFilters.clear()
    }

    //客服配置读取 Content 关键字
    val contentKeys = ObremponConfigsHelper.takeObremponMSGContentKeys()
    if (contentKeys != null){
        contentFilters.addAll(contentKeys)
    }
    return contentFilters
}